#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

from xml.etree import ElementTree as ET
import sys


def validate(file):
    try:
        ET.parse(file)
        print file + ' is a valid xml'
    except Exception, e:
        print file + ' a invalid xml'
        print file + ' Possible reasons：', e


if __name__ == "__main__":
    filename = sys.argv[1]
    validate(filename)



